import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Category from '../views/Category.vue'
import Login from '../views/Login.vue'
import ProductDetail from '../views/ProductDetail.vue'
import Cart from '../views/Cart.vue'
import CreateOrder from '../views/CreateOrder.vue'
import Address from '../views/Address.vue'
import AddressEdit from '../views/AddressEdit.vue'
import Order from '../views/Order.vue'
import OrderDetail from '../views/OrderDetail.vue'
import User from '../views/User.vue'
import Setting from '../views/Setting.vue'
import About from '../views/About.vue'

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            name: 'home',
            component: Home
        },
        {
            path: '/category',
            name: 'category',
            component: Category
        },
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/product/:id',
            name: 'product',
            component: ProductDetail
        },
        {
            path: '/cart',
            name: 'cart',
            component: Cart
        },
        {
            path: '/create-order',
            name: 'create-order',
            component: CreateOrder
        },
        {
            path: '/address',
            name: 'address',
            component: Address
        },
        {
            path: '/address-edit',
            name: 'address-edit',
            component: AddressEdit
        },
        {
            path: '/order',
            name: 'order',
            component: Order
        },
        {
            path: '/order-detail',
            name: 'order-detail',
            component: OrderDetail
        },
        {
            path: '/user',
            name: 'user',
            component: User
        },
        {
            path: '/setting',
            name: 'setting',
            component: Setting
        },
        {
            path: '/about',
            name: 'about',
            component: About
        },
    ]
})
export default router